package com.itheima.reggie.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.itheima.reggie.commen.LocalDateTimeConverter;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;
    @ExcelProperty("员工ID")
    private Long id;

    @ExcelProperty(value = "用户名",index = 0)
    private String username;

    @ExcelProperty(value = "员工姓名",index = 1)
    private String name;

    @ExcelProperty(value = "密码",index = 2)
    private String password;

    @ExcelProperty(value = "手机号",index = 3)
    private String phone;

    @ExcelProperty(value = "员工性别",index = 4)
    private String sex;

    @ExcelIgnore
    private String idNumber;

    @ExcelProperty(value = "账号状态",index = 5)
    private Integer status;

    @ExcelProperty(value = "创建时间",index = 6,converter = LocalDateTimeConverter.class)
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @lombok.Getter
    @ExcelProperty(value = "修改时间",index = 7,converter = LocalDateTimeConverter.class)
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

}
